package com.myapplication.ui.listfragment.shoplistactivity.pinglun;

import android.os.Handler;
import android.os.Looper;
import android.util.Log;

import com.myapplication.bean.CommentBean;

import java.util.List;
import java.util.Map;

/**
 * Created by zitaojiang on 2016/10/6.
 */
public class Presenter_Comment implements Contract_Comment.Presenter{
    Handler mHandler=new Handler(Looper.getMainLooper());
    private Contract_Comment.View mView;
    private Contract_Comment.Model mModel;

    public Presenter_Comment(Contract_Comment.View view){
        this.mView=view;
        mModel=new Model_Comment();
    }
    @Override
    public void GetData(String type,Map<String, String> params) {
            mModel.getData(type, params, new Model_Comment.SendCommentListener() {
                @Override
                public void sendcommentlist(List<CommentBean.DataBean.CommentsBean> itemsBeanList) {
                    if(itemsBeanList!=null){
                        mView.onGetDataSuccess(itemsBeanList);
                        Log.i("TAG", "-----sendcommentlist-----: "+itemsBeanList.size());
                    }else {
                        Log.i("TAG", "=======>sendcommentlist: "+"数据加载失败");
                        mView.onGetDataFail("网络数据加载失败");
                    }
                }
            });
    }

}
